package com.study.happystudy.controller;


import com.study.happystudy.service.impl.AiServiceImpl;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@CrossOrigin//跨域
@RestController//遵循RestFul
@RequestMapping("AI/")//请求路径
public class TranslateController {

    @Resource
     AiServiceImpl aiService;

    /**
     *
     * @param SourceLanguage 源语言
     * @param TargetLanguage 目标语言
     * @param SourceText 翻译文本
     * @return
     */
    @GetMapping("translate")
    public String translate(@RequestParam("SourceLanguage") String SourceLanguage,
                            @RequestParam("TargetLanguage") String TargetLanguage,
                            @RequestParam("SourceText") String SourceText
    ) {
        return aiService.AITranslate(SourceLanguage, TargetLanguage, SourceText);
    }
}
